import { MyAppType } from "@/router/type";
import { lazy } from "react";
import WithLoading from "@/layout/WithLoading";
import { BookFilled } from "@ant-design/icons";

const Baiscs = lazy(() => import("@/views/MyPromise/Basics"));
const Upgrade = lazy(() => import("@/views/MyPromise/Upgrade"));
const Grid = lazy(() => import("@/views/MyPromise/Grid"));

const MyPromise: MyAppType = {
  path: "/myPromise",
  name: "MyPromise",
  meta: {
    icon: <BookFilled />,
    title: "promise回顾",
    order: 4,
  },
  children: [
    {
      path: "baiscs",
      name: "Baiscs",
      element: WithLoading(<Baiscs />),
      meta: {
        title: "promise基础",
      },
    },
    {
      path: "upgrade",
      name: "Upgrade",
      meta: {
        title: "promise进阶",
      },
      element: WithLoading(<Upgrade />),
    },
    {
      path: "grid",
      name: "Grid",
      meta: {
        title: "Grid布局",
      },
      element: WithLoading(<Grid />),
    },
  ],
};

export default MyPromise;
